package top.huhuiyu.teachproject.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import top.huhuiyu.teachproject.entity.TbUser;

/**
 * tb_user表的dao
 *
 * @author 胡辉煜
 */
@Mapper
public interface TbUserDAO extends BaseMapper<TbUser> {

  /**
   * 通过登录名查询用户信息（包括被删除的用户）
   *
   * @param username 登录名
   * @return 登录名对应的用户信息
   */
  @Select("select * from tb_user where username=#{username}")
  public TbUser queryByName(String username);

  @Update("update tb_user set deleted='n' where uid=#{uid}")
  public int undelete(TbUser user);
}